import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/login/Login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/register/Register.vue')
  },
  {
    path: '/resetPwd',
    name: 'resetPwd',
    component: () => import('../views/reset/ResetPwd.vue')
  },
  {
    path: '/previewErr',
    name: 'previewErr',
    component: () => import('../views/error/previewErr.vue')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: '/home',
        name: '首页',
        meta: {
          icon: "el-icon-s-home",
        },
        component: () => import('../views/Home.vue')
      },
      {
        path: '/all',
        name: '所有文件',
        meta: {
          icon: "el-icon-menu",
        },
        component: () => import('../views/file/AllFile.vue')
      },
      {
        path: '/document',
        name: '文档文件',
        meta: {
          icon: "el-icon-document",
        },
        component: () => import('../views/file/Document.vue')
      },
      {
        path: '/ImageView',
        name: '图片文件',
        meta: {
          icon: "el-icon-picture-outline-round",
        },
        component: () => import('../views/file/ImageView.vue')
      },
      {
        path: '/video',
        name: '视频文件',
        meta: {
          icon: "el-icon-video-camera-solid",
        },
        component: () => import('../views/file/Video.vue')
      },
      {
        path: '/orther',
        name: '其他文件',
        meta: {
          icon: "el-icon-collection",
        },
        component: () => import('../views/file/Orther.vue')
      },
      {
        path: '/create',
        name: '上传/创建/共享',
        meta: {
          icon: "el-icon-upload",
        },
        component: () => import('../views/create/create.vue')
      },
      {
        path: '/folders',
        name: '我的文件夹',
        meta: {
          icon: "el-icon-folder",
        },
        component: () => import('../views/folder/Folders.vue')
      },
      {
        path: '/shareFolder',
        name: '我的共享',
        meta: {
          icon: "el-icon-share",
        },
        component: () => import('../views/folder/ShareFolder.vue')
      },
      {
        path: '/getShare',
        name: '获取共享文件',
        meta: {
          icon: "el-icon-position",
        },
        component: () => import('../views/folder/GetShare.vue')
      },
      {
        path: '/recycling',
        name: '回收站',
        meta: {
          icon: "el-icon-delete-solid",
        },
        component: () => import('../views/recycling/Recycling.vue')
      },
      {
        path: '/userManage',
        name: '用户管理',
        meta: {
          icon: "el-icon-user-solid",
        },
        component: () => import('../views/admin/UserManage.vue')
      },
      {
        path: '/adminManage',
        name: '管理员管理',
        meta: {
          icon: "el-icon-s-custom",
        },
        component: () => import('../views/admin/AdminManage.vue')
      },
      {
        path: '/storageManage',
        name: '空间管理',
        meta: {
          icon: "el-icon-pie-chart",
        },
        component: () => import('../views/admin/StorageManage.vue')
      },
      {
        path: '/resManage',
        name: '资源管理',
        meta: {
          icon: "el-icon-receiving",
        },
        component: () => import('../views/admin/ResManage.vue')
      },
      {
        path: '/recyelingManage',
        name: '回收站管理',
        meta: {
          icon: "el-icon-delete-solid",
        },
        component: () => import('../views/admin/RecyelingManage.vue')
      },
      {
        path: '/adminHome',
        name: '管理员首页',
        meta: {
          icon: "el-icon-s-home",
        },
        component: () => import('../views/admin/AdminHome.vue')
      },
    ]
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
